package com.mall.db.api;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.mall.db.mapper.UmsAdminRoleRelationMapper;
import com.mall.domain.UmsAdminRoleRelation;
import com.mall.domain.UmsRole;
import com.mall.interface1.api.UmsAdminRoleRelationApi;
import org.apache.dubbo.config.annotation.DubboReference;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

@DubboService
public class UmsAdminRoleRelationImpl implements UmsAdminRoleRelationApi {
    @Autowired
    private UmsAdminRoleRelationMapper mapper;


    @Override
    public List<UmsAdminRoleRelation> query(Long userId) {
        LambdaQueryWrapper<UmsAdminRoleRelation> wa = new LambdaQueryWrapper<>();
        wa.eq(UmsAdminRoleRelation::getAdminId,userId);
       return mapper.selectList(wa);
    }

    @Override
    public void save(UmsAdminRoleRelation re) {
        mapper.insert(re);
    }
}
